Xamarin Mobile Development for Android Cookbook by unknow

Xamarin Mobile Development for Android Cookbook by unknow

Author:unknow
Language: eng
Format: epub
Publisher: Packt Publishing


Sometimes the token becomes invalid, for example if the server or Google decide to refresh the tokens. When this happens, our app will be notified:

To handle token refresh events, we create an interface that inherits from the InstanceIDListenerService type:[Service] [IntentFilter( new []{ "com.google.android.gms.iid.InstanceID" })] public class InstanceIdService : InstanceIDListenerService { public override void OnTokenRefresh() { var instanceId = InstanceID.GetInstance(this); var token = instanceId.GetToken( "PROJECT_NUMBER", GoogleCloudMessaging.InstanceIdScope); } }



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.